package com.superm.service.impl;

import com.superm.entity.Department;
import com.superm.mappers.DepartmentMapper;
import com.superm.service.DepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DepartmentServiceImpl implements DepartmentService {
    /**
     * 部门接口
     */
    @Autowired
    private DepartmentMapper departmentMapper;
    @Override
    public List<Department> allDepartment() {
        return departmentMapper.selectAll();
    }

    @Override
    public Integer upDepartment(Department dep) {
        return departmentMapper.upDepartment(dep);
    }

    @Override
    public Integer delDepartment(Integer did) {
        return departmentMapper.delDepartment(did);
    }

    @Override
    public Integer addDepartment(Department dep) {
        return departmentMapper.addDepartment(dep);
    }

    @Override
    public Department depId(Integer did) {
        return departmentMapper.depId(did);
    }


    /**rui
     * 查询所有部门信息
     * @return
     */
    public List<Department> selectDepartmentList(){
        return departmentMapper.selectAll();
    }
}
